package com.srcptit.java.training.kienbd.btvn1;

import java.util.Scanner;

public class Muc1Bai2UCLN {
	static int USCLN(int a,int b){
            while(a*b!=0){
		if(a>b)	a=a%b;
		else	b=b%a;
            }
            return a+b;
        }
	public static void main(String args[]){
            Scanner input = new Scanner(System.in);
            String str1 = input.next();
            String str2 = input.next();
            try {
                int a = Integer.parseInt(str1);
                int b = Integer.parseInt(str2);
                System.out.print("YES! Uoc chung lon nhat "+a+" va "+b+" : ");
                System.out.println( USCLN(a,b) );
            }catch(Exception e) {
                System.out.println("No! Vui long nhap lai.");
            }
        }
}
